package com.zhou.spring.controller;

import com.zhou.spring.entity.User;
import com.zhou.spring.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

/**
 * @author zhouyanxiang
 * @create 2020-07-2020/7/13-20:57
 * controller 层是在web最开始先接入的，控制整体逻辑转发部分
 */

@Controller("UserController2")
public class UserController {
    /*默认的是byType*/

    @Autowired
    UserService userService;

   public String list(){
       String username = "Tom";
       String password = "123456";
       User user = userService.login(username, password);
       if (user == null){
           return "failed";
       }else {
           return "success";
       }
   }
}
